<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:acm="http://java.sun.com/jsf/composite/comp" >
<ui:composition template="/templates/homeLayout.xhtml">
	<ui:define name="content">
		<section id="content">
			<ui:repeat var="cat" value="#{hmpCtrl.homeGroup}">
				<div class="row-1 p1">
					<h3>#{cat.name}
					<a class="fright" href="#{facesContext.externalContext.requestContextPath}/pub/inv/invList.jsf?makeId=0&amp;modelId=0&amp;year=0&amp;price=0"><strong>View all</strong></a>
					</h3>
					<div class="wrapper">
			            <ui:repeat var="car" value="#{cat.vehicles}" varStatus="stat">				        	
			            	<div class="col-#{stat.index+1}">
			                	<div class="box">
				                	<a href="#{facesContext.externalContext.requestContextPath}/pub/inv/invDisplay.jsf?carId=#{car.vehicleId}&amp;backTo=Home Page">
				                		<figure>
				                			<h:graphicImage value="/img/?imgId=#{car.displayImage.imageId}" width="254" height="177" rendered="#{stat.index == 0}"/>
				                			<h:graphicImage value="/img/?imgId=#{car.displayImage.imageId}" width="252" height="177" rendered="#{stat.index != 0}"/>
				                		</figure>
				                	</a>
			    	            	<div>
			        	            	<p><strong>#{car.year}</strong> - #{car.make.name} #{car.model.name}</p>
				        	            <a href="#{facesContext.externalContext.requestContextPath}/pub/inv/invDisplay.jsf?carId=#{car.vehicleId}&amp;backTo=Home Page">More</a>
				        	            <del>
					        	            <h:outputText value="#{car.salePrice}" rendered="#{car.specialPrice!=null}">
					    	        	        <f:convertNumber pattern="$0,000" />
					    	        	    </h:outputText>
				    	        	    </del>
				        	            <strong>				        	            	
				    	        	        <h:outputText value="#{car.salePrice}" rendered="#{car.specialPrice==null}">
				    	        	        	<f:convertNumber pattern="$0,000" />
				    	        	        </h:outputText>
				    	        	        <h:outputText value="#{car.specialPrice}" rendered="#{car.specialPrice!=null}">
				    	        	        	<f:convertNumber pattern="$0,000" />
				    	        	        </h:outputText>
			    	        	        </strong>
			                    	</div>
			                    </div>
			                </div>				            
			            </ui:repeat>
		            </div>		            
		        </div>
			</ui:repeat>	
			<h:panelGrid width="100%" columns="2">
				<h:panelGroup layout="block" styleClass="fleft row-2" style="width: 504px; height: 414px;">
					<acm:rssReader rssUrl="http://rss.kbb.com/kbb-car-news" header="Car News"/>
				</h:panelGroup>
				<h:panelGroup layout="block" styleClass="fleft row-2" style="width: 504px; height: 414px;">
					<acm:rssReader rssUrl="http://rss.kbb.com/kbb-car-reviews" header="Car Reviews"/>
				</h:panelGroup>
			</h:panelGrid>						
	    </section>
	</ui:define>
</ui:composition>
</html>